package com.adam.design.a01abstractfactory;

import com.adam.design.a01abstractfactory.aliyun.AliyunOssFactory;
import com.adam.design.a01abstractfactory.factory.AbstractOssFactory;
import com.adam.design.a01abstractfactory.factory.product.OssImage;
import com.adam.design.a01abstractfactory.factory.product.OssVideo;
import com.adam.design.a01abstractfactory.qiniu.QiniuOssFactory;

public class AbstractFactoryDemo {
    public static void main(String[] args) {
        AbstractOssFactory factory = new AliyunOssFactory();
        OssImage ossImage = factory.uploadImage(new byte[1024]);
        OssVideo ossVideo = factory.uploadVideo(new byte[1024]);
        System.out.println(ossImage.getThumb());
        System.out.println(ossImage.getWatermark());
        System.out.println(ossImage.getEnhance());
        System.out.println(ossVideo.get720P());
        System.out.println(ossVideo.get1080P());

        System.out.println("--------------------------");
        AbstractOssFactory qiniuFactory = new QiniuOssFactory();
        ossImage = qiniuFactory.uploadImage(new byte[1024]);
        ossVideo = qiniuFactory.uploadVideo(new byte[1024]);
        System.out.println(ossImage.getThumb());
        System.out.println(ossImage.getWatermark());
        System.out.println(ossImage.getEnhance());
        System.out.println(ossVideo.get720P());
        System.out.println(ossVideo.get1080P());


    }


}
